﻿using System;
using math.Controllers;
using math.DTOs;
using math.Views;

namespace MVPDemoWebUI
{
    public partial class Arith : System.Web.UI.Page, IArith
    {
        private ArithController _controller;
        protected void Page_Load(object sender, EventArgs e)
        {
            _controller = new ArithController(this);
        }
        protected void btnFactorial_Click(object sender, EventArgs e)
        {
            _controller.HandleFactorial();
        }


        #region IArith Members

        public int InputNumber
        {
            get { return Convert.ToInt32(txtNo1.Text); }
        }

        public FactorialInfo Result
        {
            set
            {
                lblFact.Text = "Factorial of " + value.No + " is " + value.Fact;
            }
        }

        #endregion
    }
}